package com.hw.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Classname: ConfigController
 * @Description: 控制类 @RefreshScope动态刷新注解
 * @Date: 2021/11/16
 * @Author: HuWei
 */
@Slf4j
@RestController
@RequestMapping("/config/clien")
@RefreshScope
public class ConfigController {

    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/getConfigInfo")
    public String getConfigInfo(){
        log.info("客户端获取服务端的配置信息");
        return configInfo;
    }
}